# 多态
class Animal:
    # 动物都会叫
    def speak(self):
        print('我是动物我会说话')

class People(Animal):
    def speak(self):
        print('say hello')

class Dog(Animal):
    def speak(self):
        print('汪汪汪')

class Pig(Animal):
    def speak(self):
        print('哼哼哼')
# 三个对象都是动物
obj1=People()
obj2=Dog()
#  多态：统一
def obj_speak(obj):
    obj.speak()
obj_speak(obj1) # say hello
obj_speak(obj2) #
# 新增了一个类
class wcs(Animal):
    def speak(self):
        print("哈哈哈哈哈哈哈")

w1 = wcs()
obj_speak(w1)

